from rest_framework.generics import UpdateAPIView
from rest_framework.viewsets import ModelViewSet

from apps.meiduo_admin.serializers.search_filter import Seacher
from apps.orders.models import OrderInfo
from orderserializer import OrderSerializer, OrderSSerializer


# 这是订单管理视图的展示
class OrderModelViewSet(ModelViewSet):
    serializer_class =  OrderSerializer
    queryset =  OrderInfo.objects.all()
    filter_backends = [Seacher]
    search_fields = ['order_id','create_time']

# 这是详情视图的展示
class OrderStatusView(UpdateAPIView):
    queryset = OrderInfo.objects.all()
    serializer_class = OrderSSerializer
